package reduce.fz.com.reduce.activity;

import android.app.Activity;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.WindowCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;
import android.widget.Toast;

import reduce.fz.com.reduce.R;
import reduce.fz.com.reduce.util.TipUtil;

public abstract class BaseActivity extends FragmentActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        try{
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        if (getContentRid() != 0) {
            setContentView(getContentRid());
        }}
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }

    public abstract int getContentRid();

    public abstract void initWidget();

    public abstract void initListener();


    public void toastMsg(String msg) {
        TipUtil.toastMsg(msg, this);
    }

}
